﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:sys="clr-namespace:System;assembly=mscorlib">

    <sys:Double x:Key="ToolbarButtonIconWidth">32</sys:Double>
    <sys:Double x:Key="ToolbarButtonIconHeight">32</sys:Double>
    <Style x:Key="ToolbarImageStyle" TargetType="{x:Type Image}">
    	<Setter Property="Width" Value="{DynamicResource ToolbarButtonIconWidth}"/>
    	<Setter Property="Height" Value="{DynamicResource ToolbarButtonIconHeight}"/>
    </Style>
	<Style x:Key="ButtonFocusVisual">
		<Setter Property="Control.Template">
			<Setter.Value>
				<ControlTemplate>
					<Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#F3F3F3" Offset="0"/>
		<GradientStop Color="#EBEBEB" Offset="0.5"/>
		<GradientStop Color="#DDDDDD" Offset="0.5"/>
		<GradientStop Color="#CDCDCD" Offset="1"/>
	</LinearGradientBrush>
	<SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>

<Style  TargetType="{x:Type ListBoxItem}" x:Key="Win8ListBoxItem" >
	<Setter Property="Template" Value="{DynamicResource ListBoxItemControlTemplate1}"/>
</Style>

	<Style x:Key="Win8ButtonStyle" TargetType="{x:Type Button}">
		<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
		<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
		<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
		<Setter Property="BorderThickness" Value="1"/>
		<Setter Property="Foreground" Value="Black"/>
		<Setter Property="HorizontalContentAlignment" Value="Center"/>
		<Setter Property="VerticalContentAlignment" Value="Center"/>
		<Setter Property="Padding" Value="1"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Button}">
					<Grid Background="Transparent">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualStateGroup.Transitions>
									<VisualTransition GeneratedDuration="0" To="Pressed">
										<Storyboard>
											<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="foregroundContainer">
												<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="2"/>
											</DoubleAnimationUsingKeyFrames>
											<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="foregroundContainer">
												<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="2">
													<EasingDoubleKeyFrame.EasingFunction>
														<QuadraticEase EasingMode="EaseOut"/>
													</EasingDoubleKeyFrame.EasingFunction>
												</EasingDoubleKeyFrame>
											</DoubleAnimationUsingKeyFrames>
										</Storyboard>
									</VisualTransition>
									<VisualTransition From="Pressed" GeneratedDuration="0:0:0.2">
										<VisualTransition.GeneratedEasingFunction>
											<CircleEase EasingMode="EaseIn"/>
										</VisualTransition.GeneratedEasingFunction>
										<Storyboard>
											<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="foregroundContainer">
												<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
											</DoubleAnimationUsingKeyFrames>
											<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="foregroundContainer">
												<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
											</DoubleAnimationUsingKeyFrames>
										</Storyboard>
									</VisualTransition>
									<VisualTransition GeneratedDuration="0:0:0.2" To="Disabled">
										<VisualTransition.GeneratedEasingFunction>
											<CircleEase EasingMode="EaseOut"/>
										</VisualTransition.GeneratedEasingFunction>
									</VisualTransition>
									<VisualTransition From="Disabled" GeneratedDuration="0:0:0.2">
										<VisualTransition.GeneratedEasingFunction>
											<CircleEase EasingMode="EaseIn"/>
										</VisualTransition.GeneratedEasingFunction>
									</VisualTransition>
								</VisualStateGroup.Transitions>
								<VisualState x:Name="Normal"/>
								<VisualState x:Name="MouseOver"/>
								<VisualState x:Name="Pressed"/>
								<VisualState x:Name="Disabled">
									<Storyboard>
										<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.OpacityMask).(SolidColorBrush.Color)" Storyboard.TargetName="foregroundContainer">
											<EasingColorKeyFrame KeyTime="0" Value="#33000000"/>
										</ColorAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<Border x:Name="bd" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" >
							<ContentControl 
								x:Name="foregroundContainer" 
								FontFamily="{TemplateBinding FontFamily}" 
								FontSize="{TemplateBinding FontSize}" 
								Padding="{TemplateBinding Padding}" 
								Content="{TemplateBinding Content}" 
								ContentTemplate="{TemplateBinding ContentTemplate}" RenderTransformOrigin="0.5,0.5" OpacityMask="Black" >
								<ContentControl.RenderTransform>
									<TransformGroup>
										<ScaleTransform/>
										<SkewTransform/>
										<RotateTransform/>
										<TranslateTransform/>
									</TransformGroup>
								</ContentControl.RenderTransform>
							</ContentControl>
						</Border>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
		<Setter Property="RenderTransform">
			<Setter.Value>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Setter.Value>
		</Setter>
		<Setter Property="Margin" Value="8"/>
	</Style>
    
    
	<Style x:Key="ProgressBarBusyIndicator" TargetType="{x:Type ProgressBar}">
		<Setter Property="Template" Value="{DynamicResource ProgressBarControlTemplate1}"/>
	</Style>

</ResourceDictionary>